package moteur;

import java.util.LinkedHashSet;
import java.util.Set;

import utils.CollectionOps;

/**
 * This is a search for "NOT" logic.
 * For example, ~A, the search result will not contain A.
 * @author haonan
 *
 */

public class NotSearch  implements Search
{
	private Set<String> allFiles;
	private Search basicSearch;
	
	public NotSearch(Search bs, Set<String> all)
	{
		basicSearch = bs;
		allFiles = all;
	}
	
	@Override
	public Set<String> get() 
	{
		// TODO Auto-generated method stub
		return CollectionOps.minus(allFiles, basicSearch.get());
	}

	@Override
	public void print() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public Set<String> get(LinkedHashSet<String> lhs) {
		// TODO Auto-generated method stub
		 lhs.addAll(this.get());
		 return lhs;
	}


}
